<script setup lang="ts">
import { onMounted } from 'vue'

// 移动端适配
const resetHtmlFont = () => {
  // 获取html对象并动态设置font-size = 设备宽度 / 10
  if (screen.width > 540) {
    document.documentElement.style.fontSize = 54 + 'px'
  } else {
    document.documentElement.style.fontSize = screen.width / 10 + 'px'
  }
}
if (screen.width <= 540) {
  document.documentElement.style.fontSize = screen.width / 10 + 'px'
}
window.addEventListener('resize', () => resetHtmlFont())
onMounted(() => {
  resetHtmlFont()
})
</script>

<template>
  <router-view />
</template>

<style lang="scss">
@import '@/assets/reset.scss';
@import '@/assets/font.scss';
</style>
